<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script src="./vue.js"></script>
    <script>
      // const name = "jack";
      // const str = `this is ${name} ${1+2}`;
      const vm = new Vue({
        data: {
          name: "jack",
        },
        methods: {
          add(x, y) {
            return x + y;
          },
        },
        // app.outerHTML = template
        el: "#app", //id选择器
        template: "<p>this is {{this.name}} {{1+3}} {{this.add(2,3)}}</p>",
        beforeMount() {
          console.log("beforeMount", "挂载前", this.$el.innerHTML); //app.innerHTML
        },
        mounted() {
          console.log("mounted", "挂载后", this.$el.innerHTML); //app.innerHTML
        },
      });

      console.log(vm);
    </script>
  </body>
</html>
